"DESCRIPTION 1"="If you point the mouse-cursor to a file and wait about two seconds, Windows is able to display a little yellow window (ToolTip) that shows some information about that file. This way, you know what the file is about without open it."
"DESCRIPTION 2"="This plug-in allows you to customize those ToolTips or remove them. Just select the file in question and select "Change" to change the ToolTip that should appear, or "Delete" to remove the ToolTip. If the file you want to change does not appear in this list, use the "Add File ToolTip" plug-in."
"DESCRIPTION 3"="You can either define a custom static message like "This is a XQZ file" or let Windows display the document properties for that file: "prop:FileDescription;Company;FileVersion;Create;Size". If the ToolTip starts with "prop:", Windows will display the document properties. Hint: To see the available properties, just right-click a file and select the "Properties" tab."
"DESCRIPTION 4"="NOTE: This plug-in allows you to change the "simple ToolTips" only. Windows does also allow executing a program that displays the ToolTip (for example, WinZIP does this for ZIP, CAB etc. files). Since this procedure varies from program to program, this plug-in will NOT display these non-simple ToolTips and does also NOT allow you to change those ToolTips. "
"AUTHOR"="Xteq Systems"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
"COMMENT 1"="Bloody complicated plug-in!!!"
sP="HKLM\Software\Classes\"
dim iItems 'contains the total amount of the registry keys
Dim aryItems() 'contains the name of the Registry paths (direct files starting with ".")
Dim aryItemsLoc() 'contains the registry location (\ShellNew or \ShellNew-)
Dim aryDesc() 'contains the description of the items
Sub Plugin_Initialize
if RegPathExists(sP) then
Call ReadRegistry
else
Call Disable
end if
End Sub
Sub ReadRegistry
iItems=RegEnumPaths(sP)
dim aryTemp
ReDim aryTemp(iItems)
dim aryTemp2
ReDim aryTemp2(iItems)
l=1
e=1
sDebug=""
'read all data from the path
For l=1 to iItems
sItem=RegEnumElement(l)
if left(sItem,1)="." then
s=HasInfoTip(sP, sP & sItem)
If len(s)>0 then
sDebug=sDebug & sItem
aryTemp(e)=sItem
aryTemp2(e)=s
e=e+1
end if
end if
next
'Call DebugMsg(sDebug)
'okay, now count how many items we have left (that are not empty)...
iItems=0
for l=1 to e-1
If Len(aryTemp(l))>0 then
iItems=iItems+1
end if
next
'redim final arrays with this value
ReDim aryItems(iItems)
ReDim aryItemsLoc(iItems)
ReDim aryDesc(iItems)
'copy from temp array to the final ones
i=1
for l=1 to e-1
If Len(aryTemp(l))>0 then
aryItems(i)=aryTemp(l)
aryItemsLoc(i)=aryTemp2(l)
i=i+1
end if
next
'fill third array with the file description
for l=1 to iItems
aryDesc(l)=GetFileDescription(aryItems(l))
next
'AND NOW update the UI
for l=1 to iItems
Call SetUIElement(l,aryDesc(l) & " (" & aryItems(l) & ")") 'set data in X-Setup
if Right(aryItemsLoc(l),1)<>"-" then 'not disabled
Call SetUIElementEx(l,true) 'set activated
else
Call SetUIElementEx(l,false) 'set not active
end if
Next
End Sub
'VERSION 1.1
'returns the readable description for a file TYPE. Input is the
'raw file type (e.g. ".TXT").
Function GetFileDescription(DotType)
sxd_BasePath="HKLM\Software\Classes\"
sxd_Path=sxd_BasePath & DotType & "\@"
sxd_Val=RegReadValue(sxd_Path)
if IsEmpty(sxd_Val)=true then
'extended description not found! return default
GetFileDescription="<UNKNOWN>"
else
'found, now get the "real" description
sxd_Path=sxd_BasePath & sxd_Val & "\@"
sxd_Name=RegReadValue(sxd_Path)
if IsEmpty(sxd_Name)=true then
'argh!
GetFileDescription="<UNKNOWN>"
else
GetFileDescription=sxd_Name
end if
end if
End Function
'VERSION 1.0
'returns the reg path to the InfoTip value path or "" if nothing was found. Input is the
'path to the data type (e.g. "HKCR\.TXT").
Function HasInfoTip(StartPath,Path)
Dim sCheck,sReturn
xd_sV_InfoTip="\InfoTip"
sReturn=""
'first check if this file has a name. If so
'read the data from that name
s=RegReadValue(Path & "\@")
if IsEmpty(s)=false then
'<default path>\.XXX File\InfoTip
sCheck=StartPath & s & xd_sV_InfoTip
if RegValueExists(sCheck) then
sReturn=sCheck
end if
else
'okay, seems this file has no name
sCheck=Path & xd_sV_InfoTip
if RegValueExists(sCheck) then
sReturn=sCheck
end if
end if
HasInfoTip=sReturn
End Function
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
if ElementSubIndex>0 then
if ElementIndex=1 then 'change
sCurPath=aryItemsLoc(ElementSubIndex)
s=RegReadValue(sCurPath)
s=InputWindow("Please enter the ToolTip for that file e.g. <This is a XQZ file> or a <prop:xxx> string",s,1)
if IsEmpty(s)=false then
Call RegWriteValue(sCurPath,s,1)
end if
end if
if ElementIndex=2 then 'delete
sCurPath=aryItemsLoc(ElementSubIndex)
Call RegDeleteValue(sCurPath)
end if
'call the holy Windows API
Call IndicateSettingChange()
're-read UI
Call ReadRegistry
else
Call MsgWarning("Please select an item in the list.")